define(function (require) {
var zsApp= require('app');
zsApp
.controller( 'gameaddController',["$scope","$http","$state","$stateParams","$window","$timeout", "$rootScope",function($scope,$http,$state,$stateParams,$window,$timeout,$rootScope){
	$scope.gamedates=[];
	
	$scope.gamedates.push({
			terminal:'',
			resourceaddress:'',
			developmentversion:'',
			encryptedversion:'',
			encryptedpassword:'',
			DRMversion:'',
			DRMpassword:'',
  	});
  	
  
	$scope.addtr = function(){
		$scope.gamedates.push({
			terminal:'',
			resourceaddress:'',
			developmentversion:'',
			encryptedversion:'',
			encryptedpassword:'',
			DRMversion:'',
			DRMpassword:'',
  		});
	}
	$scope.deletetr = function($index){
		
		if($scope.gamedates.length == 1){
			// 操作提示
				$rootScope.prompt = true;
				$rootScope.promptStatement = "最后一行了";
				$timeout(function () {
					$rootScope.prompt = false;
					$rootScope.success = false;
				}, 1500);
		
		}else{
			$scope.gamedates.splice($index,1);
		}
	}
}])
})